/**
 * This is a header for simple multiplatform
 * Dynamic library loads.
 *
 * @copyright 2008 Kirill Gavrilov
 */

#ifndef __loadLibrary_h_
#define __loadLibrary_h_

#if (defined(_WIN32) || defined(__WIN32__))
#include <windows.h>
#else // Linux
#include <dlfcn.h>
#define HMODULE void*
#endif

/**
 * Just simple struct.
 */
struct StringLIST {
    const int size;
    const char* data[256];
};

/**
 * Function call system function to return library handle.
 * Returns NULL if not found.
 * @param destination (const char* ) - library destination;
 * @return HMODULE (means void* ) - handle of library.
 */
    HMODULE DLibLoad(const char* destination);
/**
 * Function call system function to return function address in library.
 * Returns NULL if not found.
 * @param libHandle (HMODULE = void* ) - library handle;
 * @param fname (const char* ) - function name;
 * @return void* - pointer to function in library.
 */
    void* DLibGetFunction(HMODULE libHandle, const char* fname);
/**
 * Function call system function to release library.
 * (free memory).
 * @param libHandle (HMODULE = void* ) - library handle;
 */
    void DLibFree(HMODULE libHandle);
#endif //__loadLibrary_h_


